package day4;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class ShuziSanjiao {
    public static void main(String[] args) {
        int k;
        Scanner in = new Scanner(System.in);
        while (true) {
            System.out.print("input k:");
            k = in.nextInt();
            if (k >= 1 && k <= 9) {
                break;
            }
            System.out.println("输入错误，重来！");
        }
        //行号的i和个数的关系，2i-1
        for (int i = 1; i <= k; i++) {
            //加空格
            for (int j = 1; j <= k - i; j++) {
                System.out.print(" ");
            }
            for (int j = 1; j <= 2 * i - 1; j++) {
                System.out.print(i);
            }
            System.out.println();
        }
    }
}
